package com.nb.hdj.testCase.configurationModule;

import com.nb.hdj.data.HtConfigurationEnum;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * @Description: 图库分类子菜单
 * @Author: hedongjia
 * @Date: 2021/12/24 上午10:47
 * @Version: v1.0
 */
public class GalleryClassCase extends ConfigurationCaseBase{
    /**
     * 查看图库分类
     * @param driver
     * @return
     */
    public boolean viewGalleryClass(WebDriver driver) {
        try {
            seleniumUtil.sleep(1500);
            //调用配置管理模块  查看方法
            return viewBase(driver, HtConfigurationEnum.Gallery_Class_Element.getValue(),
                    HtConfigurationEnum.CONFIGURATION_Content_First_Name_Element.getValue());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    /**
     * 新增图库分类
     * @param driver
     * @return
     */
    public boolean insertGalleryClass(WebDriver driver){
        cm.setClassName("测试图库分类").setSortNumber("1");
        return insertBase(driver,cm);
    }

    /**
     * 更改图库分类
     * @param driver
     * @return
     */
    public boolean updateGalleryClass(WebDriver driver){
        cm.setClassName("更改图库分类");
        return updateBase(driver,cm);
    }

    /**
     * 删除图库分类
     * @param driver
     * @return
     */
    public boolean deleteGalleryClass(WebDriver driver){
        return deleteBase(driver,cm);
    }


}
